Imaging apparatus and focus control method

ABSTRACT

An imaging apparatus includes: a distance measurement unit that measures distance values of a plurality of points in a first area which has a focus point as a reference point; a statistical unit that calculates statistics indicating a variation in the measured distance values of the plurality of points in the first area; a size determination unit that determines the size of a second area which has the focus point as a reference point, on the basis of the calculated statistics; a contrast evaluation value calculation unit that calculates a contrast evaluation value on the basis of an image of the second area; and a focusing unit that moves a focus lens to a lens position determined on the basis of the calculated contrast evaluation value.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present application is a Continuation of PCT InternationalApplication No. PCT/JP2017/008142 filed on Mar. 1, 2017 claimingpriority under 35 U.S.C § 119(a) to Japanese Patent Application No.2016-068792 filed on Mar. 30, 2016. Each of the above applications ishereby expressly incorporated by reference, in their entirety, into thepresent application.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to an imaging apparatus and a focuscontrol method that can appropriately focus on a desired portion of anobject regardless of whether the object has a complex shape or a simpleshape.

2. Description of the Related Art

In the related art, in contrast autofocus (AF) which searches for afocus lens position where the contrast of the image is the maximum andperforms focusing, in a case in which a plurality of object images withdifferent distances are present in a contrast evaluation focus area(referred to as a “focus area”) of the image, a perspective conflictproblem that it is difficult for a near-side object image to beappropriately in focus due to the influence of a far-side object imageoccurs between a plurality of objects. Various techniques for solvingthe perspective conflict problem have been provided.

JP2001-304855A discloses a technique that detects the face of a personand preferentially measures the distance to a detection area to reliablybring the face of the person into focus.

JP2014-123069A discloses a technique that performs first scanning whichmoves a focus lens at a high speed in a wide range from infinity to theclosest focusing distance to acquire a peak position (peak positionacquisition scanning) to detect a perspective conflict between aplurality of objects and performs second scanning (matching scanning)which moves the focus lens at a low speed in a narrow range having thepeak position of a close object or the face as the center to reacquirethe peak position in a case in which the perspective conflict isdetected. In a case in which the face is detected, it is possible tochange a distance measurement area depending on the size of the face.

JP2009-115893A discloses a technique which detects a perspectiveconflict between a plurality of objects in a contrast evaluation areaincluding a plurality of phase difference detection areas, using animaging element including a phase difference detection pixel group, andchanges the contrast evaluation area such that it includes the phasedifference detection areas of the closest object and the second closestobject and does not include other phase difference detection areas in acase in which the perspective conflict is detected.

JP2014-215506A discloses a technique which detects a perspectiveconflict between a plurality of objects in a distance detection area,using a stereo camera, changes the distance detection area such that itincludes only the objects at the same distance in a case in which theperspective conflict is detected, and performs an image recovery processsuch that the contrast of the distance detection area is the maximum.

SUMMARY OF THE INVENTION

However, it is difficult to appropriately bring a desired portion of theobject into focus regardless of whether the object has a complex shapeor a simple shape.

In the techniques disclosed in JP2001-304855A and JP2014-123069A, it ispossible to detect the face and to bring the face into focus. However,it is difficult to appropriately bring an object other than the faceinto focus. That is, the contour of a specific object or the shape ofcomponents (for example, the eyes, nose, and mouth of a person) and adetection algorithm are stored in advance and it is possible to detectthe specific object on the basis of the stored information and to bringthe specific object into focus. However, it is not practical to storethe shape of all objects and all detection algorithms in advance.Therefore, it is difficult to appropriately bring a desired portion ofany object into focus.

In addition, in the techniques disclosed in JP2014-123069A andJP2009-115893A, in a case in which an image of an object having acomplex shape that is extremely uneven as illustrated in FIG. 19 iscaptured and a portion of non-interest 94 with high contrast is locatedin front of a portion of interest 92 that is desired to be captured at ahigh resolution in a depth direction, the portion of non-interest 94 isin focus and the portion of interest 92 behind the portion ofnon-interest 94 in the depth direction is out of focus.

In addition, in a case in which an image of an object having a flatshape illustrated in FIG. 20 is captured, it is necessary to widen afocus area in order to avoid the influence of the reflection of, forexample, illumination light and to appropriately perform contrastevaluation.

In the technique disclosed in JP2014-215506A, in a case in which aportion of non-interest is located in front of a portion of interestthat is desired to be captured at a high resolution in the depthdirection, an image recovery process is performed such that the contrastof the portion of non-interest is the maximum. However, the imagerecovery process is unlikely to be appropriately performed for theportion of interest behind the portion of non-interest in the depthdirection. In addition, since contrast AF is not performed, for example,an image that enables a user to appropriately recognize microdamage (forexample, a fine crack or fissure with a width of about 0.1 mm) occurringin a concrete material and steel is unlikely to be obtained.

The invention has been made in view of the above-mentioned problems andan object of the invention is to provide an imaging apparatus and afocus control method that can appropriately focus on a desired portionof an object regardless of whether the object has a complex shape or asimple shape.

In order to achieve the object, according to a first aspect of theinvention, there is provided an imaging apparatus comprising: an imagingunit that captures an image of an object through an optical systemincluding a focus lens; a distance measurement unit that measuresdistance values of a plurality of points in a first area which is in thecaptured image and has a focus point as a reference point; a statisticalunit that calculates statistics indicating a variation in the measureddistance values of the plurality of points in the first area; a sizedetermination unit that determines a size of a second area which is usedto calculate a contrast evaluation value in the image and has the focuspoint as a reference point, on the basis of the calculated statistics; acontrast evaluation value calculation unit that calculates the contrastevaluation value at each of a plurality of lens positions, on the basisof an image of the second area in an image captured by moving the focuslens to each of the plurality of lens positions; and a focusing unitthat moves the focus lens to a lens position determined on the basis ofthe calculated contrast evaluation value.

According to this aspect, the size of the second area having the focuspoint as the reference point is determined on the basis of a variationin the distance values in the first area having the focus point as thereference point and a contrast value is calculated on the basis of theimage of the second area. Therefore, it is possible to appropriatelybring a desired portion of the object into focus in any of a case inwhich an image of an object having a complex shape is captured, a casein which an image of an object having a relatively simple and non-flatshape is captured, and a case in which an image of an object having aflat shape is captured.

According to a second aspect of the invention, in the imaging apparatus,the size determination unit reduces the size of the second area as thevariation indicated by the statistics increases. According to thisaspect, the size of the second area is determined according to thedegree of complexity of the shape of the object. Therefore, it ispossible to appropriately bring the object into focus according to thedegree of complexity of the shape of the object.

According to a third aspect of the invention, in the imaging apparatus,the size determination unit increases the size of the second area as thevariation indicated by the statistics is reduced. According to thisaspect, the size of the second area is determined on the basis of thedegree of simplicity of the shape of the object. Therefore, it ispossible to appropriately bring the object into focus according to thedegree of simplicity of the shape of the object.

According to a fourth aspect of the invention, in the imaging apparatus,the statistical unit calculates, as the statistics, a variance orstandard deviation of the distance values of the plurality of points inthe first area.

According to a fifth aspect of the invention, in the imaging apparatus,the statistical unit calculates the statistics on the basis of any oneof a mean of the distance values in the first area, a mode of thedistance values in the first area, and a distance value of a flatsurface in the first area among the distance values of the plurality ofpoints.

According to a sixth aspect of the invention, in the imaging apparatus,the contrast evaluation value calculation unit evaluates contrast in thesecond area that has a focus point indicated by an input command or thevicinity of the focus point as a center.

According to a seventh aspect of the invention, the imaging apparatusfurther comprises an area determination unit that determines anexclusion area to be excluded from the second area in the first area onthe basis of the distance values of the plurality of points in the firstarea. According to this aspect, it is possible to bring the object intofocus with higher accuracy.

According to an eighth aspect of the invention, the imaging apparatusfurther comprises an imaging direction control unit that controls animaging direction of the imaging unit to at least one of a pandirection, a tilt direction, or a roll direction. The imaging directioncontrol unit controls the imaging direction of the imaging unit on thebasis of the focus point.

According to a ninth aspect of the invention, in the imaging apparatus,the distance measurement unit is a stereo camera that performs distancemeasurement using a stereo image or an optical distance measurementdevice that performs distance measurement using light.

According to a tenth aspect of the invention, in the imaging apparatus,the imaging unit captures an image of a structure to be inspected and aninput command indicating a main inspection portion of the structure tobe inspected as the focus point is received.

According to an eleventh aspect of the invention, there is provided afocus control method comprising: a step of measuring distance values ofa plurality of points in a first area which is in an image of an objectcaptured by an imaging unit through an optical system including a focuslens and has a focus point as a reference point; a step of calculatingstatistics indicating a variation in the measured distance values of theplurality of points in the first area; a step of determining a size of asecond area which is used to calculate a contrast evaluation value inthe image and has the focus point as a reference point, on the basis ofthe calculated statistics; a step of calculating the contrast evaluationvalue at each of a plurality of lens positions, on the basis of an imageof the second area in an image captured by moving the focus lens to eachof the plurality of lens positions; and a step of moving the focus lensto a lens position determined on the basis of the calculated contrastevaluation value.

According to the invention, it is possible to appropriately bring adesired portion of an object into focus regardless of whether the objecthas a complex shape or a simple shape.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a first embodiment;

FIG. 2 is a flowchart illustrating the flow of an example of a focuscontrol process according to the first embodiment.

FIG. 3 is a diagram illustrating an example of the input of a commandindicating a focus point in the first embodiment.

FIG. 4 is a diagram illustrating an example of a focus point, a firstarea, and a second area of an object having a complex shape.

FIG. 5 is a diagram illustrating an example of a focus point, a firstarea, and a second area of an object having a relatively simple andnon-flat shape.

FIG. 6 is a diagram illustrating an example of a focus point, a firstarea, and a second area of an object having a flat shape.

FIG. 7 is a graph illustrating an example of a variation in a distancevalue in the object having a complex shape illustrated in FIG. 4.

FIG. 8 is a graph illustrating an example of a variation in a distancevalue in the object having a relatively simple and non-flat shapeillustrated in FIG. 5.

FIG. 9 is a graph illustrating an example of a variation in a distancevalue in the object having a flat shape illustrated in FIG. 6.

FIG. 10 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a second embodiment;

FIG. 11 is a flowchart illustrating the flow of an example of a focuscontrol process according to the second embodiment.

FIG. 12 is a diagram illustrating an example of the input of a commandindicating a focus point in the second embodiment.

FIG. 13 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a third embodiment;

FIG. 14 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a fourth embodiment;

FIG. 15 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a fifth embodiment;

FIG. 16 is a flowchart illustrating the flow of an example of a focuscontrol process according to the fifth embodiment.

FIG. 17 is a diagram illustrating the outward appearance of a smartphone.

FIG. 18 is a block diagram illustrating an example of the configurationof the smart phone illustrated in FIG. 17.

FIG. 19 is a first diagram illustrating the problems to be solved by theinvention.

FIG. 20 is a second diagram illustrating the problems to be solved bythe invention.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Hereinafter, an imaging apparatus and a focus control method accordingto the invention will be described with reference to the accompanyingdrawings.

First Embodiment

FIG. 1 is a block diagram illustrating an example of the configurationof an imaging apparatus according to a first embodiment.

An imaging apparatus 10A illustrated in FIG. 1 includes an opticalsystem (a first optical system 12R and a second optical system 12L)including a focus lens, an imaging unit (a first imaging unit 14R and asecond imaging unit 14L) that captures an image of an object through theoptical systems 12R and 12L, a communication unit 20 that communicateswith an apparatus outside the imaging apparatus 10A, a display unit 22that can display an image, a command input unit 24 that receives acommand input from a user, a medium interface 26 that is an interfacewith a recording medium on which images can be recorded, a storage unit28 that stores a program and information required to execute theprogram, and a control unit 50 that controls each unit of the imagingapparatus 10A according to the program stored in the storage unit 28.

A stereo camera 32 includes the optical systems 12R and 12L and theimaging units 14R and 14L. The stereo camera 32 can capture the imagesof the same object from a plurality of viewpoints and acquire amulti-viewpoint image (three-dimensional image). The first opticalsystem 12R and the first imaging unit 14R acquire a first viewpointimage and the second optical system 12L and the second imaging unit 14Lacquire a second viewpoint image.

The communication unit 20 is a wired or wireless communication device.

The display unit 22 and the command input unit 24 form a display inputunit 34. The display input unit 34 according to this example is aso-called touch panel display in which the display unit 22 displays animage and the command input unit 24 detects a touch operation of theuser for the image. The display unit 22 is a display device such as aliquid crystal display (LCD). An organic light emitting diode (OLED)display may be used. The command input unit 24 is a pointing device thatis provided on a screen of the display unit 22 so as to cover the screenof the display unit 22 and can detect a touch position. However, thecommand input unit 24 may include a keyboard and a mouse. In addition,other input devices, such as a voice input device and a gesture inputdevice, may be used.

The medium interface 26 is, for example, an input/output device thatperforms a recording process and a reading process for a memory card.

The storage unit 28 includes, for example, a read only memory (ROM), arandom access memory (RAM), and an electrically erasable programmableread only memory (EEPROM). Other storage devices may be used.

The control unit 50 is, for example, a central processing unit (CPU).

The control unit 50 includes a lens control unit 52 that controls thelens positions and F-numbers of the optical systems 12R and 12L, animaging control unit 54 that controls the imaging units 14R and 14L, adistance measurement unit 56 that measures distance values of aplurality of points in a basic focus area (hereinafter, also referred toas a “first area”) having a focus point as a reference point in theimage obtained by the imaging units 14R and 14L, a statistical unit 58that calculates statistics indicating a variation in the measureddistance values of the plurality of points in the basic focus area(first area), a size determination unit 60 that determines the size of acontrast evaluation focus area (hereinafter, also referred to as a“second area”) having the focus point as a reference point on the basisof the calculated statistics, a contrast evaluation value calculationunit 62 that calculates a contrast evaluation value at each lensposition on the basis of an image of the contrast evaluation focus area(second area) in the image captured by moving the focus lenses of theoptical systems 12R and 12L to each of the plurality of lens positions,and a focusing unit 64 that moves the focus lenses of the opticalsystems 12R and 12L to the lens position determined on the basis of thecalculated contrast evaluation value.

The distance measurement unit 56 according to this example calculatesthe distance values of a plurality of points in the basic focus area(first area) on the basis of the first viewpoint image of the objectcaptured by the first imaging unit 14R and the second viewpoint image ofthe object captured by the second imaging unit 14L and generates adistance image.

The statistical unit 58 according to this example calculates thevariance (or the standard deviation) of a plurality of distance valuesin the basic focus area (first area) as the statistics indicating avariation in the distance values.

The size determination unit 60 according to this example reduces thesize of the contrast evaluation focus area (second area) as thevariation in the distance values indicated by the statistics increases.In addition, the size determination unit 60 according to this exampleincreases the size of the contrast evaluation focus area (second area)as the variation in the distance values indicated by the statistics isreduced.

The contrast evaluation value calculation unit 62 according to thisexample acquires a contrast evaluation image by directing the lenscontrol unit 52 to move the focus lens of at least one of a plurality ofoptical systems 12R and 12L and directing the imaging control unit 54 tocontrol the imaging operation of at least one of a plurality of imagingunits 14R and 14L, and calculates a contrast evaluation value in thecontrast evaluation focus area (second area) of the image.

The focusing unit 64 according to this example moves the focus lens tothe lens position where the contrast evaluation value is the maximumamong a plurality of lens positions of the focus lens, using the lenscontrol unit 52. The focusing unit 64 according to this example movesthe focus lens of each of the plurality of optical systems 12R and 12Lon the basis of the contrast evaluation value for the image obtained byfrom at least one of the plurality of imaging units 14R and 14L.

FIG. 2 is a flowchart illustrating the flow of an example of a focuscontrol process according to the first embodiment (an example of a focuscontrol method according to the invention).

In this example, the image of a structure (for example, a bridge or abuilding) which is an inspection target is captured by the imaging units14R and 14L of the stereo camera 32. The deterioration of a structurecan be determined from the degree of damage such as cracks, fissures, orcorrosion. Examples of an inspection portion which is an imaging targetinclude a welded portion of steel and the surface of a concretematerial. For example, microdamage with a width of about 0.1 mm, such asa crack or a fissure, is important. It is important to appropriatelyperform focusing in order to appropriately determine the degree ofmicrodamage.

First, the command input unit 24 receives an input command indicating afocus point (Step S2). In this example, the command input unit 24receives an input command indicating a main inspection portion of thestructure to be inspected as the focus point.

As illustrated in FIG. 3, the display unit 22 according to this exampledisplays a live view motion picture LV which is a motion picture that isbeing captured by the imaging unit 14R or 14L. A position in the liveview motion picture LV which corresponds to a position on a screen ofthe display unit 22 touched by, for example, a finger is recognized tobe at a focus point FP. That is, the command input unit 24 according tothis example converts the coordinates of a command input position (touchposition) in a coordinate system on the screen of the display unit 22into the coordinates of the focus point FP in the coordinate system ofthe image.

Then, the distance measurement unit 56 measures the distance values of aplurality of points in the basic focus area (first area FA1) having thefocus point FP as a reference point (Step S4). In this example, thebasic focus area is a focus area with a basic size having the focuspoint FP as the center. The basic size is, for example, a predeterminedpercentage (for example, 30% of the screen) of the area of the screen ofthe display unit 22.

The distance measurement unit 56 according to this example calculatesthe distance values of a plurality of points in the basic focus area(FA1 in FIG. 3) on the basis of the first viewpoint image of the objectcaptured by the first imaging unit 14R and the second viewpoint image ofthe object captured by the second imaging unit 14L. First, the distancemeasurement unit 56 according to this example detects correspondingpoints between the first viewpoint image obtained by the first imagingunit 14R and the second viewpoint image obtained by the second imagingunit 14L, calculates the amount of parallax at each corresponding point,and generates a distance image indicating the distance values of theplurality of points from the amount of parallax.

Then, the statistical unit 58 calculates statistics indicating avariation in the distance values of the plurality of points in the basicfocus area (first area FA1) on the basis of the measured distance valuesof the plurality of points (Step S6).

The statistical unit 58 according to this example calculates a variance(or a standard deviation) on the basis of any one of the mean of thedistance values, the mode of the distance values, and a distance valueof a flat surface among the distance values of the plurality of pointsin the basic focus area (first area FA1). The “flat surface” is asurface with a flat shape such as a wall surface, and the “distancevalue of the flat surface” is a value indicating the distance to the“flat surface”.

Then, the size determination unit 60 determines the size of the contrastevaluation area (second area FA2) having the focus point as a referencepoint, on the basis of the calculated statistics (Step S8). In thisexample, the second area FA2 is an area that has, as the center, thefocus point FP corresponding to the command input through the commandinput unit 24. The second area FA2 may be an area that has, as thecenter, the vicinity of the focus point FP corresponding to the commandinput through the command input unit 24.

FIG. 4 illustrates an example of the focus point FP, the first area FA1,and the second area FA2 of an object with a complex shape. FIG. 5illustrates an example of the focus point FP, the first area FA1, andthe second area FA2 of an object with a relatively simple and non-flatshape. FIG. 6 illustrates an example of the focus point FP, the firstarea FA1, and the second area FA2 of an object with a flat shape.

FIG. 7 is a graph illustrating a variation in the distance value in theobject with a complex shape illustrated in FIG. 4. FIG. 8 is a graphillustrating a variation in the distance value in the object with arelatively simple and non-flat shape illustrated in FIG. 5. FIG. 9 is agraph illustrating a variation in the distance value in the object witha flat shape illustrated in FIG. 6. For example, the statistical unit 58according to this example calculates, as the statistics, a variance σ²(or a standard deviation a) indicating a variation (dispersion) in thedistance value based on the mean of the distance values. As illustratedin FIGS. 4 and 7, the size determination unit 60 according to thisexample reduces the size of the second area FA2 as the variationindicated by the statistics increases. Therefore, even in a case inwhich a welded portion (inspection target) with a flat shape isinterposed between the portions with complex shapes as illustrated inFIG. 4, it is possible to set the second area FA2 with a size that iscapable of appropriately determining contrast corresponding to thewelded portion. In addition, the size determination unit 60 according tothis example increases the size of the second area FA2 as the variationindicated by the statistics is reduced as illustrated in FIGS. 5, 6, 8,and 9. Therefore, for both the inspection target with a relativelysimple and non-flat shape illustrated in FIG. 5 and the inspectiontarget with a flat shape illustrated in FIG. 6, it is possible to setthe second area FA2 with an appropriate size corresponding to the degreeof simplicity of the inspection target. The size of the first area FA1is, for example, 30% of the screen size of the display unit 22. The sizeof the second area FA2 illustrated in FIG. 4 is, for example, 2% of thescreen size of the display unit 22. The size of the second area FA2illustrated in FIG. 5 is, for example, 10% of the screen size of thedisplay unit 22. The size of the second area FA2 illustrated in FIG. 6is equal to the size of the first area FA1. However, the size of thesecond area FA2 is not limited to the sizes illustrated in FIGS. 4 to 6and may be determined according to statistics.

Then, the contrast evaluation value calculation unit 62 calculates thecontrast evaluation value at each lens position on the basis of theimage (partial image) of the contrast evaluation focus area (second areaFA2) in the image (entire image) captured at each of a plurality of lenspositions of the focus lens (Step S10).

Then, the focusing unit 64 determines a lens position (focal position)where the contrast evaluation value is the maximum from the plurality oflens positions and moves the focus lens to the determined lens position(Step S12).

In the first embodiment, the integrated imaging apparatus in which thestereo camera 32, the control unit 50, and the display input unit 34 areintegrally formed has been described as an example. However, theinvention is not limited thereto.

Second Embodiment

In a second embodiment, a detachable imaging apparatus in which a stereocamera 32 can be remotely operated will be described as an example.

FIG. 10 is a block diagram illustrating an example of the configurationof an imaging apparatus according to the second embodiment. The samecomponents as those in the imaging apparatus according to the firstembodiment illustrated in FIG. 1 are denoted by the same referencenumerals and the description of the content that has been described willnot be repeated.

An imaging apparatus 10B illustrated in FIG. 10 includes a stereo camera(which is the same as the stereo camera 32 according to the firstembodiment illustrated in FIG. 1), a moving mechanism 72 that can movethe stereo camera 32 in three directions (the X direction, the Ydirection, and the Z direction perpendicular to each other), a pan/tiltmechanism 74 (which is an aspect of an “imaging direction control unit”according to the invention) that can change the imaging direction of thestereo camera 32 to a pan direction and a tilt direction, and a computerdevice 78 that remotely controls the stereo camera 32, the movingmechanism 72, and the pan/tilt mechanism 74. In this example, thepan/tilt mechanism 74 that can control the imaging direction to the pandirection and the tilt direction is used as the “imaging directioncontrol unit”. However, a mechanism that can control the imagingdirection to a roll direction may be used. In addition, a mechanism thatcontrols the imaging direction to at least one of the pan direction, thetilt direction, or the roll direction may be used as the “imagingdirection control unit”. The stereo camera 32, the moving mechanism 72,and the pan/tilt mechanism 74 form a moving body 76 to be remotelycontrolled. The moving body 76 is, for example, a “robot”.

Examples of the computer device 78 include a tablet computer and a smartphone. The user can remotely input commands related to the position ofthe stereo camera 32, the imaging direction, a focus point, and imagingconditions using the computer device 78.

The computer device 78 according to this example includes thecommunication unit 20, the display input unit 34 (the display unit 22and the command input unit 24), the medium interface 26, the storageunit 28, and the control unit 50 illustrated in FIG. 1. Thecommunication unit 20 can wirelessly communicate with the moving body76. The communication unit 20 may perform wired communication. Inaddition, the moving body 76 may be provided with some or all of thecomponents (the lens control unit 52, the imaging control unit 54, thedistance measurement unit 56, the statistical unit 58, the sizedetermination unit 60, the contrast evaluation value calculation unit62, and the focusing unit 64) of the control unit 50 illustrated in FIG.1.

FIG. 11 is a flowchart illustrating the flow of an example of a focuscontrol process according to the second embodiment. The control unit 50of the computer device 78 performs the focus control process accordingto the program stored in the storage unit 28.

First, the imaging control unit 54 of the control unit 50 sets theimaging conditions of a live view motion picture in the stereo camera 32through the communication unit 20 (Step S102). The F-number (stop value)of the optical systems 12R and 12L of the stereo camera 32 is set to,for example, “F10”. In the capture of a live view motion picture, thedepth of field is greater than that in the capture of a still image,which will be described below, in order to check the distancedistribution of the entire focus area.

Then, the imaging control unit 54 of the control unit 50 starts thecapture of a live view motion picture by the stereo camera 32 and startsthe output of the live view motion picture by the display unit 22 of thedisplay input unit 34 (Step S104). For example, the live view motionpicture is captured, transmitted, and output at a resolution of1920×1080 dots, at a rate of 60 fps (frames per second), and through twochannels.

Then, the moving mechanism 72 moves the position of the stereo camera 32in at least one of the X direction, the Y direction, or the Z directionin response to the command input from the user through the display inputunit 34 if necessary (Step S106). That is, the moving mechanism 72 movesthe moving body 76 (a robot in this example).

In addition, the pan/tilt mechanism 74 changes the imaging direction ofthe stereo camera 32 in at least one of the pan direction or the tiltdirection in response to the command input from the user through thedisplay input unit 34 if necessary (Step S108). That is, the pan/tiltmechanism 74 performs pan/tilt control for the stereo camera 32.

The display input unit 34 receives an input focus point command (StepS110). In this example, since the live view motion picture is displayedon the display input unit 34, the user can perform an operation ofinputting a focus point command while seeing the live view motionpicture. As illustrated in FIG. 12, in this example, the focus point FPis displayed at a position fixed to the center of the screen on thescreen of the display unit 22. However, the moving mechanism 72 and thepan/tilt mechanism 74 are controlled by an operation for the commandinput unit 24 such that the position (imaging position) and imagingdirection of the stereo camera 32 are changed and the live view motionpicture LV is moved on the screen of the display unit 22. That is, thefocus point FP is moved by an operation for the command input unit 24 inthe real space in which the stereo camera 32 is present.

Then, the distance measurement unit 56 of the control unit 50 acquiresone frame image of the live view motion picture in order to measure adistance value (Step S112). Since the stereo camera 32 outputstwo-system motion pictures (two-viewpoint motion pictures) withdifferent viewpoints, the distance measurement unit 56 acquires frameimages (stereo images) captured from two viewpoints at the same time.

Then, the distance measurement unit 56 of the control unit 50 measuresthe distance values of a plurality of points in the basic focus area(first area) of the frame image (Step S114).

Then, the statistical unit 58 of the control unit 50 calculates thevariance σ² of the distance values of the plurality of points in thebasic focus area (Step S116). In this example, the statistical unit 58calculates the mean of the distance values of the plurality of points inthe basic focus area and calculates the variance σ² of the distancevalues of the plurality of points in the basic focus area having themean as the center.

Then, the size determination unit 60 of the control unit 50 determinesthe size of the contrast evaluation focus area (second area) on thebasis of the variance σ² (Steps S120 to S128). In the drawings,threshold values (a first threshold value Th1 and a second thresholdvalue Th2) satisfy the following relationship: Th1>Th2. In addition, inthe drawings, the sizes of the focus area (a small size Sz1, a mediumsize Sz2, and a large size Sz3) satisfy the following relationship:Sz1<Sz2<Sz3.

In a case in which the calculated variance & is greater than the firstthreshold value Th1 (YES in Step S120), the size of the contrastevaluation focus area is determined to be the small size Sz1 (StepS122). For example, the screen size of the display input unit 34 isdetermined to be “10%”.

In a case in which the calculated variance σ² is equal to or less thanthe first threshold value Th1 and is greater than the second thresholdvalue Th2 (YES in Step S124), the size of the contrast evaluation focusarea is determined to be the medium size Sz2 (Step S126). For example,the screen size of the display input unit 34 is determined to be “20%”.

In a case in which the calculated variance σ² is equal to or less thanthe second threshold value Th2 (NO in Step S124), the size of thecontrast evaluation focus area is determined to be the large size Sz3(Step S128). For example, the screen size of the display input unit 34is determined to be “30%”.

Then, the imaging control unit 54 of the control unit 50 sets theimaging conditions of a still image in the stereo camera 32 through thecommunication unit 20 (Step S130). For example, aperture and exposureare set to “auto”. In the capture of a still image, the F-number is setto the minimum value or a value (for example, “F4”) close to the minimumvalue to reduce the depth of field to be less than that in the captureof the live view motion picture. In addition, the exposure time isshorter than that in the capture of the live view motion picture. Thatis, the imaging conditions are set such that a contrast evaluation valuecan be acquired with high accuracy and image blur caused by vibrationcan be prevented.

Then, the statistical unit 58 calculates a representative value (forexample, a mean, a mode, or a distance value of a flat surface) of thedistance values in the basic focus area (first area) (Step S132).

Then, the contrast evaluation value calculation unit 62 of the controlunit 50 determines the search range of the focal position of the focuslens on the basis of the calculated representative value (Step S134).That is, the moving range of the lens position of the focus lens isdetermined. In addition, the interval at which the lens position of thefocus lens is moved may be determined.

Then, the imaging control unit 54 of the control unit 50 performscontrol such that the capture of the live view motion picture by thestereo camera 32 is stopped (Step S136).

Then, the contrast evaluation value calculation unit 62 and the focusingunit 64 perform contrast autofocus (AF) with the determined size (thesize determined in Steps S120 to S128) and in the determined searchrange (the search range determined in Step S134) (Step S138). Thecontrast evaluation value calculation unit 62 directs the lens controlunit 52 to move the focus lens in the optical system (at least one ofthe optical system 12R or the optical system 12L) of the stereo camera32 in the determined search range and directs the imaging control unit54 to perform control such that the imaging unit (at least one of theimaging unit 14R or the imaging unit 14L) of the stereo camera 32captures an image. In addition, the contrast evaluation valuecalculation unit 62 calculates the contrast evaluation value of thecontrast evaluation focus area (second area) in the image captured bythe stereo camera 32 at each lens position of the focus lens anddetermines the lens position of the focus lens where the contrastevaluation value is the maximum as the focal position. The focusing unit64 directs the lens control unit 52 to move the lens position of thefocus lens of the stereo camera 32 to the determined focal position.

Then, the imaging control unit 54 of the control unit 50 directs thestereo camera 32 to capture a still image (Step S140).

Then, the still image captured by the stereo camera 32 is stored(recorded) in the storage unit 28 (Step S142). The still image may bestored (recorded) in a recording medium (for example, a memory card) bythe medium interface 26. In addition, the still image may be transmittedto an external apparatus through the communication unit 20.

The case in which the robot is used as the moving mechanism 72 has beendescribed. However, the invention is not limited to the above-mentionedexample. For example, an unmanned aerial vehicle (UAV) which is called a“drone” may be used as the moving mechanism 72. That is, the pan/tiltmechanism 74 and the stereo camera 32 can be provided in the unmannedaerial vehicle to form the moving body 76. The pan/tilt mechanism 74 maybe omitted.

In the first and second embodiments, the case in which the distancevalues of a plurality of points are calculated on the basis of thetwo-viewpoint image captured by the stereo camera 32 has been describedas an example. However, the invention is not limited thereto.

Third Embodiment

In a third embodiment, distance measurement is performed in atime-of-flight (TOF) manner.

FIG. 13 is a block diagram illustrating an example of the configurationof an imaging apparatus 10C according to the third embodiment. The samecomponents as those in the imaging apparatus 10A according to the firstembodiment illustrated in FIG. 1 are denoted by the same referencenumerals and the description of the content that has been described willnot be repeated.

In FIG. 13, light which has been emitted from a light emitting unit 11and then reflected from an object is guided to a light receiving surfaceof an imaging unit 14T for distance measurement by an optical system 12Tfor distance measurement. The light emitting unit 11 is, for example, aninfrared light emitting diode (LED) that emits infrared light. Theoptical system 12T for distance measurement includes a lens that guideslight reflected from the object to the light receiving surface of theimaging unit 14T for distance measurement. The imaging unit 14T fordistance measurement is, for example, a CMOS image sensor or a CCD imagesensor. Distance measurement may be performed using a laser rangefinder. An optical system 12C for color imaging includes a focus lens.An imaging unit 14C for color imaging captures an image of the objectthrough the optical system 12C for color imaging.

The light emitting unit 11, the optical system 12T, and the imaging unit14T for distance measurement and the optical system 12C and the imagingunit 14C for color imaging form a TOF camera 132. The light emittingunit 11, the optical system 12T, and the imaging unit 14T for distancemeasurement are an aspect of an optical distance measurement deviceaccording to the invention.

A control unit 150 is, for example, a CPU and includes a distancemeasurement unit 156 that performs distance measurement in a TOF manner.The distance measurement unit 156 according to this embodiment acquiresthe distance values of a plurality of points corresponding to the flighttime of light from the emission of the light from the light emittingunit 11 to the reception of the light by the imaging unit 14T fordistance measurement on the basis of the imaging result of the imagingunit 14T for distance measurement.

A focus control process of the imaging apparatus 10C according to thisexample is the same as the focus control process according to the firstembodiment described with reference to FIG. 2. However, in themeasurement of the distance values (Step S4 in FIG. 2), the distancevalues of a plurality of points are calculated in the TOF manner on thebasis of the imaging result of the imaging unit 14T for distancemeasurement in the TOF camera 132.

In the third embodiment, the integrated imaging apparatus in which theTOF camera 132, the control unit 50, and the display input unit 34 areintegrally formed have been described as an example. However, theinvention is not limited thereto.

Fourth Embodiment

In a fourth embodiment, a detachable imaging apparatus in which the TOFcamera 132 can be remotely operated will be described as an example.

FIG. 14 is a block diagram illustrating an example of the configurationof an imaging apparatus according to the fourth embodiment. The samecomponents as those in the imaging apparatus 10A according to the firstembodiment illustrated in FIG. 1, the imaging apparatus 10B according tothe second embodiment illustrated in FIG. 10, and the imaging apparatus10C according to the third embodiment illustrated in FIG. 13 are denotedby the same reference numerals and the description of the content thathas been described will not be repeated.

An imaging apparatus 10D illustrated in FIG. 14 includes a movingmechanism 72 that can move the TOF camera 132 in three directions (the Xdirection, the Y direction, and the Z direction perpendicular to eachother), a pan/tilt mechanism 74 (which is an aspect of an “imagingdirection control unit” according to the invention) that can change theimaging direction of the TOF camera 132 to the pan direction and thetilt direction, and a computer device 178 that remotely controls the TOFcamera 132, the moving mechanism 72, and the pan/tilt mechanism 74. Inaddition, a mechanism that controls the imaging direction to at leastone of the pan direction, the tilt direction, or the roll direction maybe used as the “imaging direction control unit”. The TOF camera 132, themoving mechanism 72, and the pan/tilt mechanism 74 form a moving body176 to be remotely controlled. The moving body 176 is, for example, a“robot”.

Examples of the computer device 178 include a tablet computer and asmart phone. The user can remotely input commands related to theposition, imaging direction, focus point, and imaging conditions of theTOF camera 132 using the computer device 178. In addition, some or allof the components (the lens control unit 52, the imaging control unit54, the distance measurement unit 156, the statistical unit 58, the sizedetermination unit 60, the contrast evaluation value calculation unit62, and the focusing unit 64) of the control unit 150 illustrated inFIG. 13 may be provided in the moving body 176.

For example, an unmanned aerial vehicle (UAV) which is called a “drone”may be used as the moving mechanism 72. That is, the pan/tilt mechanism74 and the TOF camera 132 can be provided in the unmanned aerial vehicleto form the moving body 176. The pan/tilt mechanism 74 may be omitted.

A focus control process of the imaging apparatus 10D according to thisexample is the same as the focus control process according to the secondembodiment described with reference to FIG. 11. However, in themeasurement of the distance values (Step S114 in FIG. 11), the distancevalues of a plurality of points are calculated in the TOF manner on thebasis of the imaging result of the imaging unit 14T for distancemeasurement in the TOF camera 132.

Fifth Embodiment

FIG. 15 is a block diagram illustrating an example of the configurationof a main portion of an imaging apparatus according to a fifthembodiment.

A control unit 50 (or 150) according to this embodiment includes an areadetermination unit 82 that determines an exclusion area to be excludedfrom a contrast evaluation focus area (second area) in a basic focusarea (first area) on the basis of the measurement results of thedistance values of a plurality of points in the basic focus area.

The control unit 50 (or 150) according to this embodiment can bereplaced with the control units 50 (or 150) according to the first tofourth embodiments.

FIG. 16 is a flowchart illustrating the flow of an example of a focuscontrol process according to the fifth embodiment. The same steps asthose in the example of the focus control process according to the firstembodiment illustrated in FIG. 2 are denoted by the same referencenumerals and the description of the content that has been described willnot be repeated.

In this embodiment, the exclusion area to be excluded from the contrastevaluation focus area (second area) in the basic focus area (first area)is determined on the basis of the measurement results of the distancevalues of a plurality of points in the basic focus area (Step S7).

In Step S8, the size determination unit 60 sets an area obtained byexcluding the exclusion area from the basic focus area (first area) asthe contrast evaluation focus area (second area) and determines the sizeof the contrast evaluation focus area.

There are various aspects in the determination of the exclusion area bythe area determination unit 82. Hereinafter, an example of thedetermination of the exclusion area will be described.

In a first aspect, the distance values of a plurality of points arecompared with the mean or mode of the distance values in the first areaand an area in which the difference between the distance values is equalto or greater than a threshold value is determined to be the exclusionarea.

In a second aspect, an area in which the distance values of a pluralityof points are not continuous with the focus point is determined to bethe exclusion area. That is, the continuity of the distance values inthe vicinity of the focus point is determined and an area in which thedistance value jumps by a predetermined value or more is determined tobe the exclusion area.

[Example of Configuration of Smart Phone]

FIG. 17 illustrates the outward appearance of a smart phone 30 which isan example of the imaging apparatus and the computer device. The smartphone 30 illustrated in FIG. 17 includes a housing 502 with a flat panelshape. The smart phone 30 includes a display input unit 520 having adisplay panel 521 as a display unit and an operation panel 522 as aninput unit which are integrally formed on one surface of the housing502. The housing 502 includes a speaker 531, a microphone 532, anoperation unit 540, and a camera unit 541. However, the configuration ofthe housing 502 is not limited thereto. For example, the display unitand the input unit may be independently provided or the housing 502 mayhave a folding structure or a sliding mechanism.

FIG. 18 is a block diagram illustrating an example of the configurationof the smart phone 30 illustrated in FIG. 17. As illustrated in FIG. 18,the smart phone 30 includes, as main components, a wirelesscommunication unit 510, the display input unit 520, a calling unit 530,the operation unit 540, the camera unit 541, a storage unit 550, anexternal input/output unit 560, a global positioning system (GPS)receiving unit 570, a motion sensor unit 580, a power supply unit 590,and a main control unit 501. In addition, the smart phone 30 has, as amain function, a wireless communication function which performs mobilewireless communication through a base station apparatus and a mobilecommunication network.

The wireless communication unit 510 performs wireless communication withthe base station apparatus which is accommodated in the mobilecommunication network in response to a command from the main controlunit 501. The wireless communication is used to transmit and receivevarious types of file data, such as voice data and image data, andelectronic mail data or to receive, for example, web data or streamingdata.

The display input unit 520 is a so-called touch panel that displays, forexample, images (still images and motion pictures) or text informationto visually transmit information to the user and detects the user'soperation for the displayed information under the control of the maincontrol unit 501 and includes the display panel 521 and the operationpanel 522.

The display panel 521 uses, for example, a liquid crystal display (LCD)or an organic light emitting diode (OELD) display as a display device.The operation panel 522 is a device that is provided such that an imagedisplayed on a display surface of the display panel 521 can be visuallyrecognized and detects one or a plurality of coordinate points operatedby a finger of the user or a pen-type input device. In a case in whichthe device is operated by a finger of the user or a pen-type inputdevice, the operation panel 522 outputs a detection signal which isgenerated by the operation to the main control unit 501. Then, the maincontrol unit 501 detects an operation position (coordinates) on thedisplay panel 521 on the basis of the received detection signal.

As illustrated in FIG. 17, the display panel 521 and the operation panel522 of the smart phone 30 are integrated to form the display input unit520 and the operation panel 522 is provided so as to completely coverthe display panel 521. In a case in which this arrangement is used, theoperation panel 522 may have a function of detecting the user'soperation even in an area other than the display panel 521. In otherwords, the operation panel 522 may include a detection area(hereinafter, referred to as a display area) for an overlap portionwhich overlaps the display panel 521 and a detection area (hereinafter,referred to as a non-display area) for an outer edge portion which doesnot overlap the display panel 521.

The size of the display area may be exactly equal to the size of thedisplay panel 521. However, the sizes are not necessarily equal to eachother. The operation panel 522 may include two sensitive areas, that is,an outer edge portion and an inner portion other than the outer edgeportion. The width of the outer edge portion is appropriately designedaccording to, for example, the size of the housing 502. Examples of aposition detection method which is used in the operation panel 522include a matrix switching method, a resistive film method, a surfaceelastic wave method, an infrared method, an electromagnetic inductionmethod, and a capacitive method. Any of the methods may be used.

The calling unit 530 includes the speaker 531 and the microphone 532.The calling unit 530 converts the voice of the user which is inputthrough the microphone 532 into voice data which can be processed by themain control unit 501 and outputs the converted voice data to the maincontrol unit 501. In addition, the calling unit 530 decodes voice datareceived by the wireless communication unit 510 or the externalinput/output unit 560 and outputs the decoded voice data from thespeaker 531. As illustrated in FIG. 17, for example, the speaker 531 canbe mounted on the same surface as the display input unit 520 and themicrophone 532 can be mounted on the side surface of the housing 502.

The operation unit 540 is a hardware key which uses, for example, a keyswitch and receives commands from the user. For example, as illustratedin FIG. 17, the operation unit 540 is a push button switch which ismounted on the side surface of the housing 502 of the smart phone 30, isturned on in a case in which it is pressed by, for example, a finger,and is turned off by the restoring force of a spring in a case in whichthe finger is taken off.

The storage unit 550 stores a control program or control data of themain control unit 501, application software, address data which isassociated with, for example, the names or phone numbers ofcommunication partners, transmitted and received electronic mail data,web data which is downloaded by web browsing, or downloaded contentdata. In addition, the storage unit 550 temporarily stores, for example,streaming data. The storage unit 550 includes an internal storage unit551 which is provided in the smart phone and an external storage unit552 which has a slot for a detachable external memory. Each of theinternal storage unit 551 and the external storage unit 552 forming thestorage unit 550 may be implemented by a storage medium, such as a flashmemory, a hard disk, a multimedia-card-micro-type memory, a card-typememory (for example, a MicroSD (registered trademark) memory), a randomaccess memory (RAM), or a read only memory (ROM).

The external input/output unit 560 functions as an interface with all ofthe external apparatuses connected to the smart phone 30 and is directlyor indirectly connected to other external apparatuses by communication(for example, universal serial bus (USB) communication) or a network(for example, the Internet, a wireless local area network (LAN), aBluetooth (registered trademark) network, a radio frequencyidentification (RFID) network, an Infrared Data Association (IrDA)(registered trademark) network, an Ultra Wideband (UWB) (registeredtrademark) network, or a ZigBee (registered trademark) network).

Examples of the external apparatus connected to the smart phone 30include a wired/wireless headset, a wired/wireless external charger, awired/wireless data port, a memory card or a subscriber identity module(SIM)/user identity module (UIM) card which is connected through a cardsocket, an external audio/video apparatus which is connected throughaudio/video input/output (I/O) terminals, a wirelessly connectedexternal audio/video apparatus, a smart phone which is connectedwirelessly or in a wired manner, a personal computer which is connectedwirelessly or in a wired manner, a personal digital assistant (PDA)which is connected wirelessly or in a wired manner, and an earphone. Theexternal input/output unit may transmit data received from the externalapparatus to each component of the smart phone 30 or may transmit datain the smart phone 30 to the external apparatus.

The GPS receiving unit 570 receives GPS signals transmitted from GPSsatellites ST1 to STn and performs a position measurement process on thebasis of a plurality of received GPS signals to detect a positionincluding the latitude, longitude, and height of the smart phone 30, inresponse to a command from the main control unit 501. In a case in whichthe GPS receiving unit 570 can acquire positional information from thewireless communication unit 510 or the external input/output unit 560(for example, a wireless LAN), it can detect the position using thepositional information.

The motion sensor unit 580 includes, for example, a triaxialacceleration sensor and detects the physical movement of the smart phone30 in response to a command from the main control unit 501. The physicalmovement of the smart phone 30 is detected to detect the movingdirection or acceleration of the smart phone 30. The detection result isoutput to the main control unit 501.

The power supply unit 590 supplies power accumulated in a battery (notillustrated) to each unit of the smart phone 30 in response to a commandfrom the main control unit 501.

The main control unit 501 includes a microprocessor, operates on thebasis of the control program or control data stored in the storage unit550, and controls the overall operation of each unit of the smart phone30. The main control unit 501 has an application processing function anda mobile communication control function of controlling each unit of acommunication system in order to perform voice communication or datacommunication through the wireless communication unit 510.

The application processing function is implemented by the operation ofthe main control unit 501 based on the application software which isstored in the storage unit 550. Examples of the application processingfunction include an infrared communication function which controls theexternal input/output unit 560 such that data communication with anopposing apparatus is performed, an electronic mail function whichtransmits and receives electronic mail, and a web browsing functionwhich browses web pages.

The main control unit 501 has, for example, an image processing functionwhich displays a video on the display input unit 520 on the basis ofimage data (still image data or motion picture data) such as receiveddata or downloaded streaming data. The image processing function meansthe function of the main control unit 501 decoding the image data,performing image processing on the decoding result, and displaying theimage on the display input unit 520.

In addition, the main control unit 501 performs display control for thedisplay panel 521 and operation detection control for detecting theoperation of the user through the operation unit 540 and the operationpanel 522.

The main control unit 501 performs the display control to display asoftware key, such as an icon for running application software or ascroll bar, or to display a window for creating electronic mail. Thescroll bar means a software key for receiving a command to move adisplayed portion of an image that is too large to fit into the displayarea of the display panel 521.

The main control unit 501 performs the operation detection control todetect the operation of the user input through the operation unit 540,to receive an operation for the icon or the input of a character stringto an input field of the window through the operation panel 522, or toreceive a request to scroll the displayed image through the scroll bar.

In addition, the main control unit 501 has a touch panel controlfunction that performs the operation detection control to determinewhether the position of an operation for the operation panel 522 is anoverlap portion (display area) which overlaps the display panel 521 oran outer edge portion (non-display area) which does not overlap thedisplay panel 521 other than the overlap portion and controls asensitive area of the operation panel 522 or the display position of thesoftware key.

The main control unit 501 can detect a gesture operation for theoperation panel 522 and can perform a predetermined function accordingto the detected gesture operation. The gesture operation does not mean asimple touch operation according to the related art, but means anoperation which draws a trace using a finger, an operation whichdesignates a plurality of positions at the same time, or a combinationthereof which draws a trace for at least one of the plurality ofpositions.

The camera unit 541 is a digital camera that electronically capturesimages using an imaging element such as a complementary metal oxidesemiconductor (CMOS) image sensor or a charge coupled device (CCD) imagesensor. In addition, the camera unit 541 can convert captured image datainto image data compressed in, for example, a Joint Photographic CodingExperts Group (JPEG) format, record the image data on the storage unit550, or output the image data through the external input/output unit 560or the wireless communication unit 510, under the control of the maincontrol unit 501. In the smart phone 30 illustrated in FIG. 17, thecamera unit 541 is mounted on the same surface as the display input unit520. However, the mounting position of the camera unit 541 is notlimited thereto. For example, the camera unit 541 may be mounted on therear surface of the display input unit 520. Alternatively, a pluralityof camera units 541 may be mounted. In a case in which the plurality ofcamera units 541 are mounted, the camera units 541 used for imaging maybe switched such that the independent camera unit 541 captures images orthe plurality of camera units 541 may be used at the same time tocapture images.

The camera unit 541 can be used for various functions of the smart phone30. For example, the image acquired by the camera unit 541 may bedisplayed on the display panel 521 or the image acquired by the cameraunit 541 may be used as one of the operation inputs of the operationpanel 522. In a case in which the GPS receiving unit 570 detects theposition, the position may be detected with reference to the image fromthe camera unit 541. In addition, the optical axis direction of thecamera unit 541 in the smart phone 30 may be determined or the currentusage environment may be determined, with reference to the image fromthe camera unit 541, using the triaxial acceleration sensor or withoutusing the triaxial acceleration sensor. Of course, the image from thecamera unit 541 may be used in the application software.

In addition, for example, the positional information acquired by the GPSreceiving unit 570, the voice information acquired by the microphone 532(for example, the voice information may be converted into textinformation by the main control unit), and the posture informationacquired by the motion sensor unit 580 may be added to still image dataor motion picture data and the image data may be recorded on the storageunit 550 or may be output through the external input/output unit 560 orthe wireless communication unit 510.

The embodiments of the invention have been described above. However, theinvention is not limited to the above-described embodiments andmodification examples and various modifications and changes of theinvention can be made without departing from the scope and spirit of theinvention.

EXPLANATION OF REFERENCES

-   -   10A, 10B, 10C, 10D: imaging apparatus    -   11: light emitting unit    -   12C, 12L, 12R, 12T: optical system    -   14C, 14L, 14R, 14T: imaging unit    -   20: communication unit    -   22: display unit    -   24: command input unit    -   26: medium interface    -   28: storage unit    -   30: smart phone    -   32: stereo camera    -   34: display input unit    -   50: control unit    -   52: lens control unit    -   54: imaging control unit    -   56: distance measurement unit    -   58: statistical unit    -   60: size determination unit    -   62: contrast evaluation value calculation unit    -   64: focusing unit    -   72: moving mechanism    -   74: pan/tilt mechanism    -   76: moving body    -   78: computer device    -   82: area determination unit    -   92: portion of interest    -   94: portion of non-interest    -   132: TOF camera    -   150: control unit    -   156: distance measurement unit    -   178: computer device    -   501: main control unit    -   502: housing    -   510: wireless communication unit    -   520: display input unit    -   521: display panel    -   522: operation panel    -   530: calling unit    -   531: speaker    -   532: microphone    -   540: operation unit    -   541: camera unit    -   550: storage unit    -   551: internal storage unit    -   552: external storage unit    -   560: external input/output unit    -   570: receiving unit    -   570: GPS receiving unit    -   580: motion sensor unit    -   590: power supply unit    -   FA1: first area    -   FA2: second area    -   FP: focus point    -   LV: live view motion picture    -   ST1: GPS satellite    -   Sz1: small size    -   Sz2: medium size    -   Sz3: large size    -   Th1: first threshold value    -   Th2: second threshold value    -   σ: standard deviation    -   σ²: variance

What is claimed is:
 1. An imaging apparatus comprising: an imaging unitthat captures an image of an object through an optical system includinga focus lens; a distance measurement unit that measures distance valuesof a plurality of points in a first area which is in the captured imageand has a focus point as a reference point; a statistical unit thatcalculates statistics indicating a variation in the measured distancevalues of the plurality of points in the first area; a sizedetermination unit that determines a size of a second area which is usedto calculate a contrast evaluation value in the image and has the focuspoint as a reference point, on the basis of the calculated statistics; acontrast evaluation value calculation unit that calculates the contrastevaluation value at each of a plurality of lens positions, on the basisof an image of the second area in an image captured by moving the focuslens to each of the plurality of lens positions; and a focusing unitthat moves the focus lens to a lens position determined on the basis ofthe calculated contrast evaluation value.
 2. The imaging apparatusaccording to claim 1, wherein the size determination unit reduces thesize of the second area as the variation indicated by the statisticsincreases.
 3. The imaging apparatus according to claim 1, wherein thesize determination unit increases the size of the second area as thevariation indicated by the statistics is reduced.
 4. The imagingapparatus according to claim 1, wherein the statistical unit calculates,as the statistics, a variance or standard deviation of the distancevalues of the plurality of points in the first area.
 5. The imagingapparatus according to claim 4, wherein the statistical unit calculatesthe statistics on the basis of any one of a mean of the distance valuesin the first area, a mode of the distance values in the first area, anda distance value of a flat surface in the first area among the distancevalues of the plurality of points.
 6. The imaging apparatus according toclaim 1, wherein the contrast evaluation value calculation unitevaluates contrast in the second area that has a focus pointcorresponding to an input command or the vicinity of the focus point asa center.
 7. The imaging apparatus according to claim 1, furthercomprising: an area determination unit that determines an exclusion areato be excluded from the second area in the first area on the basis ofthe distance values of the plurality of points in the first area.
 8. Theimaging apparatus according to claim 1, further comprising: an imagingdirection control unit that controls an imaging direction of the imagingunit to at least one of a pan direction, a tilt direction, or a rolldirection, wherein the imaging direction control unit controls theimaging direction of the imaging unit on the basis of the focus point.9. The imaging apparatus according to claim 1, wherein the distancemeasurement unit is a stereo camera that performs distance measurementusing a stereo image or an optical distance measurement device thatperforms distance measurement using light.
 10. The imaging apparatusaccording to claim 1, wherein the imaging unit captures an image of astructure to be inspected, and an input command indicating a maininspection portion of the structure to be inspected as the focus pointis received.
 11. A focus control method comprising: a step of measuringdistance values of a plurality of points in a first area which is in animage of an object captured by an imaging unit through an optical systemincluding a focus lens and has a focus point as a reference point; astep of calculating statistics indicating a variation in the measureddistance values of the plurality of points in the first area; a step ofdetermining a size of a second area which is used to calculate acontrast evaluation value in the image and has the focus point as areference point, on the basis of the calculated statistics; a step ofcalculating the contrast evaluation value at each of a plurality of lenspositions, on the basis of an image of the second area in an imagecaptured by moving the focus lens to each of the plurality of lenspositions; and a step of moving the focus lens to a lens positiondetermined on the basis of the calculated contrast evaluation value.